package org.iteam.bank.signed.model;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

/**
 * 用户信息
 * 
 * @author wenke
 *
 */
public class P2PUserInfo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3927288982470043370L;
	private String id;
	/**
	 * 用户名
	 */
	private String userName;
	/**
	 * 手机号
	 */
	private String mobile;
	/**
	 * 邮箱
	 */
	private String email;
	/**
	 * 真实姓名
	 */
	private String trueName;
	/**
	 * 用户昵称
	 */
	private String nickName;
	/**
	 * 身份证号码
	 */
	private String idcard;
	/**
	 * 银行卡号码
	 */
	private String cardno;
	/**
	 * 2审核中 1为已认证，0为未认证，默认为0
	 */
	private Integer cardNoStatus = 0;
	/**
	 * 电子账户号码
	 */
	private String eCardNo;
	/**
	 * 银行代码
	 */
	private String bankCode;
	/**
	 * 银行名称
	 */
	private String bankName;

	/** 登录密码 */
	private String password;
	/** 密码关键字 */
	private String solt;
	/** 是否删除 */
	private Integer isDeleted;

	/** 协议号码 */
	private String protocolNo;
	/**
	 * 常用地址
	 */
	private String commonAddress;
	/** qq */
	private String qq;
	/** 邀请码 */
	private String invitationCode;
	/** 会员账户表主键 */
	private String p2pAccount_id;
	/** 帐号类型 0 会员 1 平台自有资金账户 2为zdsoft类型 3企业客户 */
	private Integer accountType;
	/** 注册时间 */
	private Long registertime;

	private String address;// 地址

	private String area;// 地区

	private String city;// 城市
	private String province;// 省份
	private String ecpTelephone;// 紧急联系人

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getEcpTelephone() {
		return ecpTelephone;
	}

	public void setEcpTelephone(String ecpTelephone) {
		this.ecpTelephone = ecpTelephone;
	}

	public Integer getAccountType() {
		return accountType;
	}

	public void setAccountType(Integer accountType) {
		this.accountType = accountType;
	}

	public String getP2pAccount_id() {
		return p2pAccount_id;
	}

	public void setP2pAccount_id(String p2pAccount_id) {
		this.p2pAccount_id = p2pAccount_id;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTrueName() {
		return trueName;
	}

	public void setTrueName(String trueName) {
		this.trueName = trueName;
	}

	public Long getRegistertime() {
		return registertime;
	}

	public void setRegistertime(Long registertime) {
		this.registertime = registertime;
	}

	public String getIdcard() {
		return idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}

	public String getCardno() {
		return cardno;
	}

	public void setCardno(String cardno) {
		this.cardno = cardno;
	}

	public String geteCardNo() {
		return eCardNo;
	}

	public void seteCardNo(String eCardNo) {
		this.eCardNo = eCardNo;
	}

	public String getBankCode() {
		return bankCode;
	}

	public void setBankCode(String bankCode) {
		this.bankCode = bankCode;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public Integer getCardNoStatus() {
		return cardNoStatus;
	}

	public void setCardNoStatus(Integer cardNoStatus) {
		this.cardNoStatus = cardNoStatus;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSolt() {
		return solt;
	}

	public void setSolt(String solt) {
		this.solt = solt;
	}

	public Integer getIsDeleted() {
		return isDeleted;
	}

	public void setIsDeleted(Integer isDeleted) {
		this.isDeleted = isDeleted;
	}

	public String getProtocolNo() {
		return protocolNo;
	}

	public void setProtocolNo(String protocolNo) {
		this.protocolNo = protocolNo;
	}

	public String getSimpleEmail() {
		if (StringUtils.isNotBlank(email)) {
			String[] tempStr = email.split("@");
			int length = tempStr[0].length();
			StringBuffer temp = new StringBuffer();
			int s = 2;
			if (length < 8) {
				s = 1;
			} else {
				s = 2;
			}
			if (length <= 4) {
				temp.append(tempStr[0].substring(0, 1));
				for (int i = 0; i < length - 1; i++) {
					temp.append("*");
				}
			} else {
				temp.append(tempStr[0].substring(0, s));
				for (int i = 0; i < length - s * 2; i++) {
					temp.append("*");
				}
				temp.append(tempStr[0].substring(length - s, length));
			}
			temp.append("@");
			temp.append(tempStr[1]);
			return temp.toString();
		}
		return "";
	}

	public String getSimpleTrueName() {
		if (StringUtils.isNotBlank(trueName)) {
			int length = trueName.length();
			StringBuffer temp = new StringBuffer();
			if (length >= 6) {
				temp.append(trueName.substring(0, 2));
				for (int i = 0; i < length - 4; i++) {
					temp.append("*");
				}
				temp.append(trueName.substring(length - 2, length));
			} else {
				for (int i = 0; i < length - 1; i++) {
					temp.append("*");
				}
				temp.append(trueName.substring(length - 1, length));
			}

			return temp.toString();
		}
		return "";
	}

	public String getSimpleCardno() {
		if (StringUtils.isNotBlank(cardno)) {
			int length = cardno.length();
			StringBuffer temp = new StringBuffer();
			for (int i = 0; i < length - 4; i++) {
				temp.append("*");
			}
			temp.append(cardno.substring(length - 4, length));
			return temp.toString();
		}
		return "";
	}

	public String getSimpleIdcard() {
		if (StringUtils.isNotBlank(idcard)) {
			int length = idcard.length();
			StringBuffer temp = new StringBuffer();
			for (int i = 0; i < length - 4; i++) {
				temp.append("*");
			}
			temp.append(idcard.substring(length - 4, length));
			return temp.toString();
		}
		return "";
	}

	public String getSimpleECardNo() {
		if (StringUtils.isNotBlank(eCardNo)) {
			int length = eCardNo.length();
			StringBuffer temp = new StringBuffer();
			for (int i = 0; i < length - 4; i++) {
				temp.append("*");
			}
			temp.append(eCardNo.substring(length - 4, length));
			return temp.toString();
		}
		return "";
	}

	public String getCommonAddress() {
		return commonAddress;
	}

	public void setCommonAddress(String commonAddress) {
		this.commonAddress = commonAddress;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public String getInvitationCode() {
		return invitationCode;
	}

	public void setInvitationCode(String invitationCode) {
		this.invitationCode = invitationCode;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

}
